public class SumofRecur {
	public static void main (String args[]) {
	
	int sum = 0;  

	int N = Integer.parseInt(args[0]);
	
	for(int i=1;i<=N;++i)
		sum += fact(i);
	System.out.println(sum);
    }
    public static int fact(int N) {
        if (N == 0)
            return 1;
        else
            return N * fact(N-1);
    }
}
